package com.wechat.common.security.context;

import com.alibaba.ttl.TransmittableThreadLocal;

public class UserInfoContext {

    private static final TransmittableThreadLocal<Long> USER_CONTEXT = new TransmittableThreadLocal<>();

    public static Long getUserId() {
        return USER_CONTEXT.get();
    }

    public static void setUserId(Long userId) {
        USER_CONTEXT.set(userId);
    }

    public static void removeUserId() {
        USER_CONTEXT.remove();
    }
}
